﻿#include <iostream>
using namespace std;
int main()
{
	int a;
	char b;
	bool c;
	string d;
	//在面个变量前加*就变成了指针（指针变量）不能与普通变量重名
	int* pa = &a;
	char* pb = &b;
	bool* pc = &c;
	string* pd = &d;

	cout << "变量a的地址是：" << &a << endl;
	cout << "变量b的地址是：" << &b << endl;
	cout << "变量c的地址是：" << &c << endl;
	cout << "变量d的地址是：" << &d << endl;

	cout << "变量a的地址是：" << (void*)&a << endl;
	cout << "变量b的地址是：" << (void*)&b << endl;
	cout << "变量c的地址是：" << (void*)&c << endl;
	cout << "变量d的地址是：" << (void*)&d << endl;

	cout << "变量a的地址是：" << (long long)&a << endl;
	cout << "变量b的地址是：" << (long long)&b << endl;
	cout << "变量c的地址是：" << (long long)&c << endl;
	cout << "变量d的地址是：" << (long long)&d << endl;

	cout << "变量a的地址是：" << (long long)pa << endl;
	cout << "变量b的地址是：" << (long long)pb << endl;
	cout << "变量c的地址是：" << (long long)pc << endl;
	cout << "变量d的地址是：" << (long long)pd << endl;
}

